<?php $controller = Yii::app()->getController()->getId().'/'.Yii::app()->getController()->getAction()->getId()?>
<div class="paging">
	<?php if($pages->getPageCount() > 1){ ?>
			<ul>
			<?php if($pages->getMyCurrentPage() > 1){ ?>
				<li><a href="<?php echo $pages->myCreatePageUrl($controller, 1); ?>">1</a></li>
			<?php } ?>		
			<?php if($pages->getMyCurrentPage() > 3){ ?>
				<li>...</li>
			<?php } ?>	
			
			<?php if(($pages->getMyCurrentPage()-1) && ($pages->getMyCurrentPage()-1>1) && ($pages->getPageCount() > $pages->getMyCurrentPage()-1)){ ?>
				<li><a href="<?php echo $pages->myCreatePageUrl($controller, $pages->getMyCurrentPage()-1); ?>"><?php echo $pages->getMyCurrentPage()-1; ?></a></li>
			<?php } ?>
			<?php if($pages->getPageCount() >= $pages->getMyCurrentPage()){ ?>
				<li class="active"><a href="<?php echo $pages->myCreatePageUrl($controller, $pages->getMyCurrentPage()); ?>"><?php echo $pages->getMyCurrentPage(); ?></a></li>
			<?php } ?>
			<?php if($pages->getPageCount() >= $pages->getMyCurrentPage()+1){ ?>
				<li><a href="<?php echo $pages->myCreatePageUrl($controller, $pages->getMyCurrentPage()+1); ?>"><?php echo $pages->getMyCurrentPage()+1; ?></a></li>
			<?php } ?>
								
			<?php if($pages->getPageCount() > 3 && ($pages->getPageCount()-$pages->getMyCurrentPage() > 2)){ ?>
				<li>...</li>
			<?php } ?>
			<?php if($pages->getPageCount() > 2 && ($pages->getPageCount()-$pages->getMyCurrentPage() > 1)){ ?>
				<li><a href="<?php echo $pages->myCreatePageUrl($controller, $pages->getPageCount()); ?>"><?php echo $pages->getPageCount(); ?></a></li>
			<?php } ?>
		</ul>
	<?php } ?>
</div>